﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="DeviceInterfaceData.cs" company="Matthias Friedrich">
//   Copyright © Matthias Friedrich 2009
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace DeviceManagement
{
	using System;

	public class DeviceInterfaceData
	{
		private readonly SP_DEVICE_INTERFACE_DATA deviceInterfaceData;

		private readonly SP_DEVICE_INTERFACE_DETAIL_DATA deviceInterfaceDetailData;

		internal DeviceInterfaceData(SP_DEVICE_INTERFACE_DATA deviceInterfaceData, SP_DEVICE_INTERFACE_DETAIL_DATA detailData)
		{
			this.deviceInterfaceData = deviceInterfaceData;
			this.deviceInterfaceDetailData = detailData;
		}

		public string DevicePath
		{
			get
			{
				if (!SP_DEVICE_INTERFACE_DETAIL_DATA.Empty.Equals(this.deviceInterfaceDetailData))
				{
					return this.deviceInterfaceDetailData.DevicePath;
				}

				return null;
			}
		}

		public DeviceInterfaceDataFlags Flags
		{
			get
			{
				return (DeviceInterfaceDataFlags)this.deviceInterfaceData.Flags;
			}
		}

		/// <summary>
		///     The GUID for the class to which the device interface belongs.
		/// </summary>
		public Guid InterfaceClassGuid
		{
			get
			{
				return this.deviceInterfaceData.InterfaceClassGuid;
			}
		}
	}
}